package com.kexio.enterprise;

import com.kexio.enterprise.cache.EnterpriseCacheAutoConfiguration;
import com.kexio.enterprise.governance.GovernanceAutoConfiguration;
import com.kexio.enterprise.integration.IntegrationAutoConfiguration;
import com.kexio.enterprise.observability.ObservabilityAutoConfiguration;
import com.kexio.enterprise.properties.EnterpriseProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;

/**
 * Enterprise Starter 自动配置类
 * 
 * @author Kexio Team
 * @since 1.0.0
 */
@AutoConfiguration
@ComponentScan(basePackages = "com.kexio.enterprise")
@EnableConfigurationProperties(EnterpriseProperties.class)
@ConditionalOnProperty(prefix = "kexio.enterprise", name = "enabled", havingValue = "true", matchIfMissing = true)
@AutoConfigureAfter(name = "com.kexio.dynamic.DynamicAutoConfiguration")
@Import({
    ObservabilityAutoConfiguration.class,
    IntegrationAutoConfiguration.class,
    GovernanceAutoConfiguration.class,
    EnterpriseCacheAutoConfiguration.class
})
public class EnterpriseAutoConfiguration {
    
    private static final Logger log = LoggerFactory.getLogger(EnterpriseAutoConfiguration.class);
    
    public EnterpriseAutoConfiguration() {
        log.info("==> Kexio Enterprise Starter 自动配置已启用");
    }
}
